#[doc = "Register `PERI_PMC32` reader"]
pub struct R(crate::R<PERI_PMC32_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<PERI_PMC32_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<PERI_PMC32_SPEC>> for R {
    fn from(reader: crate::R<PERI_PMC32_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Field `hpm2_rcc` reader - RCC code output by HPM2."]
pub struct HPM2_RCC_R(crate::FieldReader<u8, u8>);
impl HPM2_RCC_R {
    pub(crate) fn new(bits: u8) -> Self {
        HPM2_RCC_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for HPM2_RCC_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `hpm2_pc_record3` reader - Reported value of the HPM2 original code word (last three historical values)."]
pub struct HPM2_PC_RECORD3_R(crate::FieldReader<u16, u16>);
impl HPM2_PC_RECORD3_R {
    pub(crate) fn new(bits: u16) -> Self {
        HPM2_PC_RECORD3_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for HPM2_PC_RECORD3_R {
    type Target = crate::FieldReader<u16, u16>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `hpm2_pc_record2` reader - Reported value of the HPM2 original code word (last two historical values)."]
pub struct HPM2_PC_RECORD2_R(crate::FieldReader<u16, u16>);
impl HPM2_PC_RECORD2_R {
    pub(crate) fn new(bits: u16) -> Self {
        HPM2_PC_RECORD2_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for HPM2_PC_RECORD2_R {
    type Target = crate::FieldReader<u16, u16>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bits 24:28 - RCC code output by HPM2."]
    #[inline(always)]
    pub fn hpm2_rcc(&self) -> HPM2_RCC_R {
        HPM2_RCC_R::new(((self.bits >> 24) & 0x1f) as u8)
    }
    #[doc = "Bits 12:21 - Reported value of the HPM2 original code word (last three historical values)."]
    #[inline(always)]
    pub fn hpm2_pc_record3(&self) -> HPM2_PC_RECORD3_R {
        HPM2_PC_RECORD3_R::new(((self.bits >> 12) & 0x03ff) as u16)
    }
    #[doc = "Bits 0:9 - Reported value of the HPM2 original code word (last two historical values)."]
    #[inline(always)]
    pub fn hpm2_pc_record2(&self) -> HPM2_PC_RECORD2_R {
        HPM2_PC_RECORD2_R::new((self.bits & 0x03ff) as u16)
    }
}
#[doc = "PERI_PMC32 is the HPM2 original code word and RCC code report register.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [peri_pmc32](index.html) module"]
pub struct PERI_PMC32_SPEC;
impl crate::RegisterSpec for PERI_PMC32_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [peri_pmc32::R](R) reader structure"]
impl crate::Readable for PERI_PMC32_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets PERI_PMC32 to value 0"]
impl crate::Resettable for PERI_PMC32_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
